ViewModelViewHost class¶
Attributes: [RequiresUnreferencedCode("This method uses reflection to determine the view model type at runtime, which may be incompatible with trimming.")] [RequiresDynamicCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")] [DebuggerDisplay("{ViewModel}")]
Defined in
Namespace: ReactiveUI.Reactive.Maui
Assembly: ReactiveUI.Maui.Reactive.dll
Full name: ReactiveUI.Reactive.Maui.ViewModelViewHost<T>
Modifiers: public
Summary¶
This content view will automatically load and host the view for the given view model. The view model whose view is
to be displayed should be assigned to the inherited view-model property. Optionally, the chosen view can be
customized by specifying a contract through the inherited contract members.
Applies to
net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-windows10.0.19041, net10.0-browserwasm1.0, net10.0-desktop1.0, net10.0-maccatalyst26.0, net10.0-tvos26.0, net9.0-desktop1.0, net9.0-windows10.0.19041
Class hierarchy
classDiagram
class ViewModelViewHost~T~
class ViewModelViewHost
ViewModelViewHost <|-- ViewModelViewHost~T~
class IViewFor~TViewModel~ {
<>
}
IViewFor~TViewModel~ <|.. ViewModelViewHost~T~
class IViewFor {
<>
}
IViewFor <|.. ViewModelViewHost~T~
class IActivatableView {
<>
}
IActivatableView <|.. ViewModelViewHost~T~
Inherits from: ViewModelViewHost
Implements: IViewFor
Remarks¶
This is the AOT-compatible generic version of ViewModelViewHost. It uses compile-time type information
to resolve views without reflection, making it safe for Native AOT and trimming scenarios.
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| ViewModel | Gets or sets the view model whose associated view is to be displayed. |
Methods¶
| Name | Summary |
|---|---|
| ResolveViewForViewModel | Resolves and displays the view for the given view model with respect to the contract. This method uses the generic ResolveView method which is AOT-compatible. |
Inherited members
ReactiveUI.Reactive.Maui.ViewModelViewHost.ViewModelPropertyReactiveUI.Reactive.Maui.ViewModelViewHost.DefaultContentPropertyReactiveUI.Reactive.Maui.ViewModelViewHost.ViewContractObservablePropertyReactiveUI.Reactive.Maui.ViewModelViewHost.ContractFallbackByPassPropertyReactiveUI.Reactive.Maui.ViewModelViewHost.#ctorReactiveUI.Reactive.Maui.ViewModelViewHost.ResolveViewForViewModel(System.Object,System.String)ReactiveUI.Reactive.Maui.ViewModelViewHost.ViewModelReactiveUI.Reactive.Maui.ViewModelViewHost.DefaultContentReactiveUI.Reactive.Maui.ViewModelViewHost.ViewContractObservableReactiveUI.Reactive.Maui.ViewModelViewHost.ViewContractReactiveUI.Reactive.Maui.ViewModelViewHost.ContractFallbackByPassReactiveUI.Reactive.Maui.ViewModelViewHost.ViewLocatorSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)System.Object.ToString